#include <stdio.h>
unsigned get_pow_2(unsigned v)
    {
        /*v--;
		printf("%u\n",v);
        v |= v >> 1;
        v |= v >> 2;
        v |= v >> 4;
        v |= v >> 8;
        v |= v >> 16;
        v++;*/
		unsigned int n=1;
		if(v==0||v>2147483648) 
			return 0;
		while(v>n) {
			n*=2;
		}
        return n;
    }
int main() {
	unsigned int v=0;
	scanf("%u",&v);
	printf("%u\n",get_pow_2(v));
	return 0;
}
//第一个程序，输出比输入的数大的二进制数

#include <stdio.h>

int is_pow_2(unsigned int n) {
    /*int m = n&(n-1);
    return m==0;*/
    unsigned long long m = 1;
    while(m<(unsigned long long)n) {
        m*=2;
    }
    return m==n;
}

int main()
{
    unsigned int n;
    scanf("%d",&n);
    printf("%d\n",is_pow_2(n));
    return 0;
}
//第二个程序，输出是否为二进制数